﻿using Report_IDal.TiJian;
using Report_Unity.Unitys;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Report_Dal.TiJian
{
    public class TJ_PDF_BGDal: ITJ_PDF_BGDal
    {
        private SqlHelper sqlHelper = null;
        public TJ_PDF_BGDal(string conn)
        {
            sqlHelper = new SqlHelper(conn);
        }

        public string GetPDF(string hid, string tjh)
        {
            string result = string.Empty;
            string sql = $@"SELECT HttpUrl FROM TJ_PDF_BG WHERE [单位ID]='{hid}' AND [体检号]='{tjh}'";
            DataTable dt = sqlHelper.GetData(sql, System.Data.CommandType.Text);
            if (dt != null && dt.Rows.Count > 0)
                result = dt.Rows[0]["HttpUrl"].ToString();

            return result;
        }


    }
}
